<!--
	作者：956911785@qq.com
	时间：2018-10-18
	描述：教师-添加
-->

<template>
	<Tcontent ref="Tcontent" :teas="params" :title="title" @addsave="addsave"></Tcontent>
</template>

<script>
	import Tcontent from "./Tcontent";
	export default {
		name:"addteacher",
		props: {
    		
    	},
		data() {
			return {
				params:{
					tname:'',
					jianjie:'',
					photo:''
				},
				title:'新增教师'
			}
		},
		components: {
			Tcontent
		},
		methods: {
			addsave:function(datas){	
				const params={
					tname:datas.tname,
					jianjie:datas.jianjie,
					photo:datas.photo
				}
				//保存
				this.$http.post("/host/stgl/teacher/Insert_Teacher.html",params)
				.then(result => {
					//添加成功 刷新页面
					if(result){
						this.$Modal.success({
                            title: "成功",
                            content: "添加成功！",
                            onOk: () => {
                            	this.$refs.Tcontent.modal0 = false;
					    		this.params={
									tname:'',
									jianjie:'',
									photo:''
								}
					    		this.$emit("reload");
                            }
                       });
					}else{
						this.$Modal.error({
                            title: "失败",
                            content: "添加失败！"
                        });	
					}
				});
	        },
			closeModal(){
				this.$refs.Tcontent.modal0 = false;
			},
			openmodal(){
				this.$refs.Tcontent.modal0 = true;
			}
		},
		mounted() {

		},
		watch:{
			
		},
		computed: {
			
		}
		
	}
</script>

<style scoped="scoped">
	 .demo-upload-list{
        display: inline-block;
        width: 100px;
        height: auto;
        text-align: center;
        line-height: 60px;
        border: 1px solid transparent;
        border-radius: 4px;
        overflow: hidden;
        background: #fff;
        position: relative;
        box-shadow: 0px;
        margin-right: 4px;
        float:left;
        margin-left: 4px;
    }
    .demo-upload-list img{
        width: 100%;
        height: 100%;
    }
    .demo-upload-list-cover{
        display: none;
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(0,0,0,.6);
    }
    .demo-upload-list:hover .demo-upload-list-cover{
        display: block;
    }
    .demo-upload-list-cover i{
        color: #fff;
        font-size: 20px;
        cursor: pointer;
        margin: 0 2px;
    }
</style>



